package com.bdqn.SJ.dao;

import com.bdqn.SJ.pojo.Supplier;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.support.SqlSessionDaoSupport;

import java.util.List;

public class SuplierMapperImpl extends SqlSessionDaoSupport implements SupplierMapper {

    //mybatis-spring包中提供的实现了SqlSession接口的类，用来操作数据库
    private SqlSessionTemplate sqlSession;

    @Override
    public List<Supplier> selectSupplierList(Supplier supplier) {
        //return sqlSession.getMapper(SupplierMapper.class).selectSupplierList(supplier);
        return this.getSqlSession().getMapper(SupplierMapper.class).selectSupplierList(supplier);
    }

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }
}
